package com.example.churp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.parse.LogInCallback;
import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseTwitterUtils;
import com.parse.ParseUser;


public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		 Parse.initialize(this, "7m3wcIrbhd0pl9DeiNa5U1SV6pWk5rnEYpsFYPHI", "t5XTwXfn4lcBYP4ls9IzQb3LeY1jYDe646e8Tzi9");
		 ParseTwitterUtils.initialize("jXr3ZlOcglW8clNIzMVw", "LufPfbLAOtog4I2vljpF4gRgKDi6l8yGZszhFFvnDM");
		
		 ParseTwitterUtils.logIn(this, new LogInCallback() {
			  @Override
			  public void done(ParseUser user, ParseException err) {
			    if (user == null) {
			      Log.d("MyApp", "Uh oh. The user cancelled the Twitter login.");
			    } else if (user.isNew()) {
			      Log.d("MyApp", "User signed up and logged in through Twitter!");
			      
			    } else {
			      Log.d("MyApp", "User logged in through Twitter!");
			    }
			  }
			});
	}

	
	public void openRecord(View view){
		Intent intent = new Intent(this, Record.class);
		startActivity(intent);
	}

}
